<noindex>
    <div class="model-selection">
        <dl>
            <dt>Укажите ваш бренд</dt>
            <dd>
                <div class="wrap-bg">
                    <noindex>
                        <div class="type-text">
                            <?php
                            $this->widget('zii.widgets.jui.CJuiAutoComplete', array(
                                'name' => 'city',
                                'source' => $searches,
                                // additional javascript options for the autocomplete plugin
                                'options' => array(
                                    'minLength' => '0',
                                    'showAnim' => 'fold',
                                    'select' => 'js: function(event, ui)
							{
							
								window.location.href = "/" + ui.item.url;
								return false;
							}',
                                ),
                                'htmlOptions' => array(
                                    'placeholder' => 'Название бренда',
                                ),
                            ));
                            ?>


                        </div>
                    </noindex>
                </div>     
            </dd>
        </dl>
        <p>Например: <a href="/<?php echo $random; ?>"><?php echo isset($array[$random]) ? $array[$random] : ''; ?></a></p>
    </div> 
</noindex>
<?php $this->widget('application.modules.main.widgets.cityPhonesInModelPage', array('title' => 'Если у Вас сложности с поиском бренда, позвоните нам и получите бесплатную консультацию:')); ?>
<h2 class="middle-title"><?php if (!empty($otherBrands)): ?>Популярные производители<?php else: ?>Выберите производителя<?php endif; ?></h2>  
<div class="brand-list">
    <ul>
        <?php foreach ($datas as $data): ?>
            <li>
                <div class="brand-list__item">
                    <div class="brand-list__photo">
                        <?php
                        $src = $this->getImageUrl('/image/resize/164x97/uploads/images/brand/' . $data['pageImages']);
                        echo CHtml::link('<img src="' . $src . '" alt="' . Controller::$pageData['pageTitle'] . ' ' . $data['pageTitle'] . '">', $data['pageUrl']);
                        ?>			
                    </div>
                    <span>
                        <?php echo CHtml::link($data['pageTitle'], '/' . $data['pageUrl']); ?>						
                    </span>
                </div>    
            </li>
        <?php endforeach; ?>
    </ul>
</div> 
<?php if (!empty($otherBrands)): ?>
    <div id="all-brands" class="brand-list" style="display: none;">
        <ul>
            <?php foreach ($otherBrands as $data): ?>
                <li>
                    <div class="brand-list__item">
                        <div class="brand-list__photo">
                            <?php
                            $src = $this->getImageUrl('/image/resize/164x96/uploads/images/brand/' . $data['pageImages']);
                            echo CHtml::link('<img src="' . $src . '" alt="' . Controller::$pageData['pageTitle'] . ' ' . $data['pageTitle'] . '">', $data['pageUrl']);
                            ?>			
                        </div>
                        <span>
                            <?php echo CHtml::link($data['pageTitle'], '/' . $data['pageUrl']); ?>						
                        </span>
                    </div>    
                </li>
            <?php endforeach; ?>
        </ul>
    </div> 
    <fieldset style="text-align: center;">
        <div class="type-submit">
            <input id="show-all" type="submit" value="Показать всех производителей">					
        </div>       
    </fieldset>
    <br /><br />
<?php endif; ?>

<script>
    $(function () {
        $("#show-all").click(function () {
            $("#all-brands").toggle("highlight", 1000);
            $(this).hide();
        });
    });
</script>
<?php
if (in_array(Controller::$pageData['pageId'], array(3, 6, 10))) {
    if (Controller::$pageData['pageId'] == 3) {
        $cid = 21640;
    }
    if (Controller::$pageData['pageId'] == 6) {
        $cid = 90607;
    }
    if (Controller::$pageData['pageId'] == 10) {
        $cid = 91406;
    }
    $this->widget('application.modules.main.widgets.CategoryPriceList', array('category' => $cid));
}
?>
<?php $this->widget('application.modules.main.widgets.cityPhonesInModelPage'); ?>
<style>
    .ui-autocomplete {
        max-height: 200px;
        overflow-y: auto;
        /* prevent horizontal scrollbar */
        overflow-x: hidden;
        /* add padding to account for vertical scrollbar */
        padding-right: 20px;
    }
    /* IE 6 doesn't support max-height
     * we use height instead, but this forces the menu to always be this tall
     */
    * html .ui-autocomplete {
        height: 100px;
    }

</style>
